const express = require('express')
const router = express.Router()
 


const { authenticateJWT } = require('./jwt')

// 登录相关,配置token
const login = require('./api/login')
router.post('/login',login.login)
router.get('/captcha',login.captcha); //获取图形验证码


const patient = require('./api/patient')
//患者管理相关，get方法
router.get('/patientlists',authenticateJWT,patient.patientlists)
router.post('/patientlistsinsert',authenticateJWT,patient.patientlistsinsert)           //新增数据
router.get('/patientlistsinserts',authenticateJWT,patient.patientlistsinserts)     //新增患者信息
router.post('/patientserch',authenticateJWT,patient.patientserch)   //搜索
//post方法
router.get('/patientid',authenticateJWT,patient.patientid)  //根据id查询信息
router.get('/patientcard',authenticateJWT,patient.patientcard) //根据id查询就诊卡信息
router.post('/patientupdate',authenticateJWT,patient.patientupdate) //编辑患者信息
router.post('/patientlogoff',authenticateJWT,patient.patientlogoff) //注销
router.post('/patientcardlogoff',authenticateJWT,patient.patientcardlogoff) //就诊卡作废挂失
router.post('/patientcardinsert',authenticateJWT,patient.patientcardinsert) //新增就诊卡号
router.get('/patientmedical',authenticateJWT,patient.patientmedical)    //根据病历号查询患者信息


// 登录日志相关
const loginlog = require('./api/loginlog')
router.get('/loginloglists',authenticateJWT,loginlog.loginloglists) //查询
router.get('/loginlogserch',authenticateJWT,loginlog.loginlogserch) //搜索

// 参数配置相关
const parameter = require('./api/parameter')
router.get('/parameterlists',authenticateJWT,parameter.parameterlists)
router.post('/parameterinsert',authenticateJWT,parameter.parameterinsert)   //新增
router.post('/parameterdel',authenticateJWT,parameter.parameterdel) //删除
router.get('/parameterlistsID',authenticateJWT,parameter.parameterlistsID)  //根据id查询信息
router.post('/parameterupdate',authenticateJWT,parameter.parameterupdate) //修改
router.get('/parameterserch',authenticateJWT,parameter.parameterserch)  //搜索

// 字典管理
const dictionary = require('./api/dictionary')
router.get('/dictionarylists',authenticateJWT,dictionary.dictionarylists)
router.get('/dictionarydetaillists',authenticateJWT,dictionary.dictionarydetaillists)
router.post('/dictionarydetailinsert',authenticateJWT,dictionary.dictionarydetailinsert)    //新增
router.post('/dictionarydetailupdate',authenticateJWT,dictionary.dictionarydetailupdate)    //更新
router.post('/dictionarydetaildel',authenticateJWT,dictionary.dictionarydetaildel)      //删除


// 挂号管理
const registration = require('./api/doctor')
router.get('/departlists',authenticateJWT,registration.departlists) //查询科室
router.get('/doctorlists',authenticateJWT,registration.doctorlists) //查询医生
router.get('/datelists',authenticateJWT,registration.datelists)     //查询日期
router.get('/schedulecountlists',authenticateJWT,registration.schedulecountlists)   //查询号源
router.get('/doctorinfo',authenticateJWT,registration.doctorinfo)   //查询医生信息
router.get('/doctorinfoApp',authenticateJWT,registration.doctorinfoApp) //查询app医生信息
router.get('/seldate',authenticateJWT,registration.seldate)     //日期id查日期
router.post('/registerlist',authenticateJWT,registration.registerlist)    //添加信息
router.get('/registerlistsel',authenticateJWT,registration.registerlistsel) //查询挂号信息
router.get('/registerliststa',authenticateJWT,registration.registerliststa) //根据状态查询
router.get('/registerlistid',authenticateJWT,registration.registerlistid)  //根据id查询信息
router.post('/registerlistcan',authenticateJWT,registration.registerlistcan) // 取消挂号
router.get('/blacklist',authenticateJWT,registration.blacklist) //查询黑名单
router.post('/blacklistinsert',authenticateJWT,registration.blacklistinsert)    //添加黑名单
router.post('/blacklistdel',authenticateJWT,registration.blacklistdel) //移除黑名单
router.get('/blacklistserach',authenticateJWT,registration.blacklistserach) //搜索







// app日期选择
const dates = require('./api/dates')
router.get('/dateslists',authenticateJWT,dates.dateslists)      //查询列表
router.post('/dateslistsinsert',dates.dateslistsinsert)     //新增列表
router.get('/schedutimes',authenticateJWT,dates.schedutimes)    //查询时间段内排班数
router.get('/scheduDate',authenticateJWT,dates.scheduDate)      //根据日期查询排班

// app登录相关查询
const applogin = require('./api/appuser')
router.post('/appuserlists',applogin.appuserlists)  //根据电话号码匹配用户信息
router.post('/appuserpsw',applogin.appuserpsw)      //密码登录查询用户信息

router.post('/appregisterlist',authenticateJWT,applogin.appregisterlist)    //app挂号
router.get('/appforget',applogin.appforget)         //忘记密码
router.post('/appchange',applogin.appchange)        //修改密码
router.get('/appselectid',authenticateJWT,applogin.appselectid) //根据用户id查询信息
router.get('/appfamily',authenticateJWT,applogin.appfamily)     //根据用户id查询家庭成员
router.post('/appregister',authenticateJWT,applogin.appregister)    //注册成功添加信息
router.post('/appfamilyadd',authenticateJWT,applogin.appfamilyadd)  //添加就诊人家庭成员

// 医生排班
router.get('/doctorschedut',authenticateJWT,dates.doctorschedut)    //根据科室查询医生排班情况
router.post('/insetsechedus',authenticateJWT,dates.insetsechedus)   //新增排班
router.post('/schecusreduce',authenticateJWT,applogin.schecusreduce)    //挂号成功数量-1

router.get('/appregisterinfo',authenticateJWT,applogin.appregisterinfo) //查询用户挂号订单
router.post('/appregisterconcel',authenticateJWT,applogin.appregisterconcel)    //取消挂号订单
router.get('/apppayfrees',authenticateJWT,applogin.apppayfrees)         //查询门诊缴费列表
router.post('/bingapply',authenticateJWT,applogin.bingapply)            //用户开单申请
router.get('/applyselect',authenticateJWT,applogin.applyselect)         //用户开单查询
router.post('/appchangestate',authenticateJWT,applogin.appchangestate)  //开单状态修改
router.get('/applyselectreacord',authenticateJWT,applogin.applyselectreacord) //开单查询
router.post('/appchangetime',authenticateJWT,applogin.appchangetime)    //支付时间修改
router.get('/appselectpatientid',authenticateJWT,applogin.appselectpatientid)   //切换就诊人查询patientid
router.get('/appselectstatuslist',authenticateJWT,applogin.appselectstatuslist) //根据状态查询开单记录列表
router.get('/appselectregister',authenticateJWT,applogin.appselectregister)     //自助取号查询患者id
router.get('/appselectoffnum',authenticateJWT,applogin.appselectoffnum)         //根据患者id查询取号信息
router.get('/appoffnumstatus',authenticateJWT,applogin.appoffnumstatus)         //取号切换状态
router.get('/appofferdetail',authenticateJWT,applogin.appofferdetail)           //取号详情查询
router.post('/appoffernum',authenticateJWT,applogin.appoffernum)                //取号操作
router.post('/appoffernuminsert',authenticateJWT,applogin.appoffernuminsert)    //取号列表新增
router.get('/appselectreturn',authenticateJWT,applogin.appselectreturn)         //查询复诊信息

// 医技预约
router.get('/pendingappointment',authenticateJWT,applogin.pendingappointment)   //待预约列表查询
router.post('/pendingappointmentadd',authenticateJWT,applogin.pendingappointmentadd)    //医技预约新增
router.post('/pendingappointmentupdate',authenticateJWT,applogin.pendingappointmentupdate)  //医技预约预约
router.get('/pendingappointmentlist',authenticateJWT,applogin.pendingappointmentlist)       //医技预约列表查询
router.post('/pendingappointmentclose',authenticateJWT,applogin.pendingappointmentclose)    //取消预约


//百度ai
const serve = require('./api/sever')
module.exports = router